-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GIE] Support PathExpand
with OPT=ALL_V_E
in GIE
#2841
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2841 +/- ##
==========================================
- Coverage 45.30% 42.59% -2.72%
==========================================
Files 99 99
Lines 10668 10657 -11
==========================================
- Hits 4833 4539 -294
- Misses 5835 6118 +283 see 16 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
PathExpand
with OPT=AllVE
in RuntimePathExpand
with OPT=ALL_VE
in GIE
@@ -20,7 +20,8 @@ | |||
|
|||
public enum ResultOpt implements IntEnum<ResultOpt> { | |||
EndV, | |||
AllV; | |||
AllV, | |||
AllVe; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AllVe
is strange, either AllVE
, if the compiler complains, change everything to full name, ie., EndVertex
, AllVertex
, AllVertexEdge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as AllVE
.
@@ -2175,6 +2175,7 @@ mod graph { | |||
pub enum PathResultOpt { | |||
EndV = 0, | |||
AllV = 1, | |||
AllVe = 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the above AllVe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as AllVE
.
SimpleAllV(Vec<Vertex>), | ||
EndV((Vertex, usize)), | ||
SimpleEndV((Vertex, Vec<ID>)), | ||
AllV(Vec<VertexOrEdge>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is already a complex combination, we may want to include two enum, one is PathOpt, one is ResultOpt, as what we have defined in proto
. namely,
pub struct GraphPath {
path_opt: PathOpt,
reult_opt: ResultOpt,
data: Vec<VertexOrEdge>
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some path may not need to preserve the whole path data of Vec<VertexOrEdge>
(e.g., when EndV
or SimpleEndV
here).
@@ -352,6 +353,9 @@ fn build_and_try_fuse_get_v(builder: &mut JobBuilder, mut get_v: pb::GetV) -> Ir | |||
return Ok(()); | |||
} | |||
} | |||
} else if let physical_pb::physical_opr::operator::OpKind::Path(ref _path) = op_kind { | |||
// make opt of getV after path expand as End. | |||
get_v.opt = physical_pb::get_v::VOpt::End as i32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using std::mem::transmute
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -168,7 +168,7 @@ impl QueryParams { | |||
} | |||
|
|||
pub fn is_queryable(&self) -> bool { | |||
!(self.labels.is_empty() && self.filter.is_none() && self.limit.is_none() && self.columns.is_none()) | |||
!(self.filter.is_none() && self.limit.is_none() && self.columns.is_none()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove labels.is_empty()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this function as it is not used.
if let Some(edge_expand) = base.edge_expand.take() { | ||
base_expand_plan.push(edge_expand.into()); | ||
if pb::path_expand::ResultOpt::AllVe as i32 == path.result_opt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use std::mem::transmute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// no label constraint | ||
Ok(true) | ||
} else { | ||
if let Some(label) = label { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we want to allow None
label input in the function on the one hand, while throwing error while calling None
label on the other hand? Simple pass &LabelId
instead of Option<&LabelId>
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is to test if a vertex satisfied the label condition (i.e., filter by label):
- if without label condition, just return true (ignoring whether the label of
RuntimeVertex
isSome(&LabelId)
orNone
); - if with label condition, then it would further verify the RuntimeVertex label. And actually, RuntimeVertex will always carry the label for now (i.e., won't throw the error actually).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, then this function should not accept Option<&LabelId>, but let the called judge.
let mut result_collection: Vec<Vec<ID>> = vec![]; | ||
let mut expected_result_paths = vec![ | ||
// v1, e[1->2], v2 | ||
vec![1, 1, 2, 2], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making the element String
, and if it is a vertex, turn ID into String, and if it is an Edge, turn (ID, ID) into string. This will make the results more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
PathExpand
with OPT=ALL_VE
in GIEPathExpand
with OPT=ALL_V_E
in GIE
interactive_engine/executor/ir/graph_proxy/src/apis/graph/element/path.rs
Show resolved
Hide resolved
impl GraphPath { | ||
pub fn new(entry: Vertex, path_opt: PathOpt, result_opt: ResultOpt) -> Self { | ||
pub fn new<E: Into<VertexOrEdge>>(entry: E, path_opt: PathOpt, result_opt: ResultOpt) -> Self { | ||
match result_opt { | ||
ResultOpt::EndV => match path_opt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ResultOpt and PathOpt are both from pb, includes the whole path, like: pb::xx::xx::ResultOpt
. In addition, I know ResultOpt::AllVe
is generated, but can we avoid generating this name (that is inconsistent with our naming convention).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
What do these changes do?
As titled.
You can query a path expand with both vertices and edges preserved by specify the
ResultOpt
asALL_V_E
. e.g.,Related issue number
Fixes #2776